home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  3.8 KB  |  150 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __TOOLUTILS__
  18. #define __TOOLUTILS__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __QUICKDRAW__
  27. #include <Quickdraw.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <QuickdrawText.h>                                    */
  31.  
  32. #ifndef __OSUTILS__
  33. #include <OSUtils.h>
  34. #endif
  35. /*    #include <Memory.h>                                            */
  36.  
  37. #ifndef __TEXTUTILS__
  38. #include <TextUtils.h>
  39. #endif
  40. /*    #include <Script.h>                                            */
  41. /*        #include <IntlResources.h>                                */
  42. /*        #include <Events.h>                                        */
  43.  
  44. #ifndef __FIXMATH__
  45. #include <FixMath.h>
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. #if GENERATINGPOWERPC
  53. #pragma options align=mac68k
  54. #endif
  55.  
  56. #ifdef __CFM68K__
  57. #pragma lib_export on
  58. #endif
  59.  
  60.  
  61. enum {
  62.     sysPatListID                = 0,
  63.     iBeamCursor                    = 1,
  64.     crossCursor                    = 2,
  65.     plusCursor                    = 3,
  66.     watchCursor                    = 4
  67. };
  68.  
  69. struct Int64Bit {
  70.     long                            hiLong;
  71.     unsigned long                    loLong;
  72. };
  73. typedef struct Int64Bit Int64Bit;
  74.  
  75. extern pascal Fixed FixRatio(short numer, short denom)
  76.  ONEWORDINLINE(0xA869);
  77. extern pascal Fixed FixMul(Fixed a, Fixed b)
  78.  ONEWORDINLINE(0xA868);
  79. extern pascal short FixRound(Fixed x)
  80.  ONEWORDINLINE(0xA86C);
  81. extern pascal void PackBits(Ptr *srcPtr, Ptr *dstPtr, short srcBytes)
  82.  ONEWORDINLINE(0xA8CF);
  83. extern pascal void UnpackBits(Ptr *srcPtr, Ptr *dstPtr, short dstBytes)
  84.  ONEWORDINLINE(0xA8D0);
  85. extern pascal Boolean BitTst(const void *bytePtr, long bitNum)
  86.  ONEWORDINLINE(0xA85D);
  87. extern pascal void BitSet(void *bytePtr, long bitNum)
  88.  ONEWORDINLINE(0xA85E);
  89. extern pascal void BitClr(void *bytePtr, long bitNum)
  90.  ONEWORDINLINE(0xA85F);
  91. extern pascal long BitAnd(long value1, long value2)
  92.  ONEWORDINLINE(0xA858);
  93. extern pascal long BitOr(long value1, long value2)
  94.  ONEWORDINLINE(0xA85B);
  95. extern pascal long BitXor(long value1, long value2)
  96.  ONEWORDINLINE(0xA859);
  97. extern pascal long BitNot(long value)
  98.  ONEWORDINLINE(0xA85A);
  99. extern pascal long BitShift(long value, short count)
  100.  ONEWORDINLINE(0xA85C);
  101. #if GENERATING68K
  102. extern pascal void LongMul(long a, long b, Int64Bit *result)
  103.  ONEWORDINLINE(0xA867);
  104. #else
  105. #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  106. #endif
  107. #if OLDROUTINELOCATIONS
  108. extern pascal Handle GetIcon(short iconID)
  109.  ONEWORDINLINE(0xA9BB);
  110. extern pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  111.  ONEWORDINLINE(0xA94B);
  112. #endif
  113. extern pascal PatHandle GetPattern(short patternID)
  114.  ONEWORDINLINE(0xA9B8);
  115. extern pascal CursHandle GetCursor(short cursorID)
  116.  ONEWORDINLINE(0xA9B9);
  117. extern pascal PicHandle GetPicture(short pictureID)
  118.  ONEWORDINLINE(0xA9BC);
  119. extern pascal Fixed SlopeFromAngle(short angle)
  120.  ONEWORDINLINE(0xA8BC);
  121. extern pascal short AngleFromSlope(Fixed slope)
  122.  ONEWORDINLINE(0xA8C4);
  123. extern pascal long DeltaPoint(Point ptA, Point ptB)
  124.  ONEWORDINLINE(0xA94F);
  125. extern pascal void ShieldCursor(const Rect *shieldRect, Point offsetPt)
  126.  ONEWORDINLINE(0xA855);
  127. extern pascal void ScreenRes(short *scrnHRes, short *scrnVRes)
  128.  SIXWORDINLINE(0x225F, 0x32B8, 0x0102, 0x225F, 0x32B8, 0x0104);
  129. extern pascal void GetIndPattern(Pattern *thePat, short patternListID, short index);
  130. #if CGLUESUPPORTED
  131. extern void shieldcursor(const Rect *shieldRect, Point *offsetPt);
  132. extern long deltapoint(Point *ptA, Point *ptB);
  133. #endif
  134. #define HiWord(x) ((short)((long)(x) >> 16))
  135. #define LoWord(x) ((short)(x))
  136.  
  137. #ifdef __CFM68K__
  138. #pragma lib_export off
  139. #endif
  140.  
  141. #if GENERATINGPOWERPC
  142. #pragma options align=reset
  143. #endif
  144.  
  145. #ifdef __cplusplus
  146. }
  147. #endif
  148.  
  149. #endif /* __TOOLUTILS__ */
  150.